using System;
using System.Diagnostics;
using System.Timers;
using wecker.contracts;

namespace wecker.werk {
    public class Aktuelle_Uhrzeit_bestimmen : IAktuelle_Uhrzeit_bestimmen {
        private Timer m_tim;

        public void Process() {
            m_tim = new Timer(1000);
            m_tim.Elapsed += jedeSekunde;
            m_tim.Start();
        }

        private void jedeSekunde(object p_Sender,
                                 ElapsedEventArgs p_E) {
            Trace.TraceInformation( "Timer.jedeSekunde " + DateTime.Now );
            Result(DateTime.Now);
        }

        public event Action<DateTime> Result;
    }
}